package com.chen.wow.profile;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test {

	public static void main(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
		ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");
		context.getEnvironment().setActiveProfiles("pro");
		context.register(ProfileConfig.class);
		context.refresh();//重新加载
		
		DemoBean demoBean = context.getBean(DemoBean.class);
		System.out.println(demoBean.getTitle());
		
		context.close();
	}

}
